Conversation
initial setup of real estate module - Done Basic structure of estate module - Done Estate Property Model Using ORM -Done
bea4c23 to
c66d6ed
Compare
Solved Previous Issue Chapter 4 - done Security File Added
c66d6ed to
002667b
Compare
Views folder created with XML data file Action and Menu added in UI Learned how actions and menus work
Remaining Exercises - Done Added Active fields with Default Value Added State field with their Values
312f1cb to
8a9ce27
Compare
2 Exercise Solved Added List view to display records Added Form view to display one record in detail
mash-odoo
left a comment
There was a problem hiding this comment.
Hello!
Great start on the app..
I have added some comments..mostly nits.
Also please update the PR title
Applied all requested changes Added Search view Added Domain by filter and Group by filter
Completed Exercise 1 ,2 and 3 Added New models, fields, Action and Menus Completed Many2one and Many2many relations
c78f742 to
44870df
Compare
mash-odoo
left a comment
There was a problem hiding this comment.
Hello!
Good going on the task...
Here are a few questions and suggestions.
| postcode = fields.Char() | ||
| date_availability = fields.Date(string="Available from", copy=False, default=lambda self: fields.Date.today() + timedelta(days=90)) | ||
| expected_price = fields.Float(required=True) | ||
| selling_price = fields.Float(readonly=True, copy=True) |
There was a problem hiding this comment.
Do you know like where should we give readonly?
- While declaring a field in .py file
- While displaying it in UI side
There was a problem hiding this comment.
we can give readonly for both .py and UI side
When the field should be readonly everywhere by default then we write it under .py and for UI if we want specific view to be readonly then we can add readonly to that specific view .
| status = fields.Selection( | ||
| [ | ||
| ('Accepted', "Accepted"), | ||
| ('Refused', "Refused") | ||
| ] | ||
| , copy=False) |
There was a problem hiding this comment.
| status = fields.Selection( | |
| [ | |
| ('Accepted', "Accepted"), | |
| ('Refused', "Refused") | |
| ] | |
| , copy=False) | |
| status = fields.Selection( | |
| [ | |
| ('accepted', "Accepted"), | |
| ('refused', "Refused") | |
| ], | |
| copy=False) |
Try keeping the key in lowercase
| <filter name="available" string="Available" | ||
| domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"/> |
There was a problem hiding this comment.
Can you rewrite this domain in an optimized way?
| <filter name="available" string="Available" | ||
| domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"/> | ||
| <filter name="group_postcode" string="Postcode" | ||
| context="{'group_by':'postcode'}"/> |
There was a problem hiding this comment.
| context="{'group_by':'postcode'}"/> | |
| context="{'group_by': 'postcode'}"/> |
| <sheet> | ||
|
|
||
| <h1> | ||
| <field name="name" placeholder="Enter title..."/> | ||
| </h1> | ||
|
|
||
| <group> | ||
| <group> | ||
| <field name="tag_id" widget="many2many_tags"/> | ||
| <field name="postcode"/> |
There was a problem hiding this comment.
| <sheet> | |
| <h1> | |
| <field name="name" placeholder="Enter title..."/> | |
| </h1> | |
| <group> | |
| <group> | |
| <field name="tag_id" widget="many2many_tags"/> | |
| <field name="postcode"/> | |
| <sheet> | |
| <h1> | |
| <field name="name" placeholder="Enter title..."/> | |
| </h1> | |
| <group> | |
| <group> | |
| <field name="tag_id" widget="many2many_tags"/> | |
| <field name="postcode"/> |
Remove unnecessary empty lines from the entire file
| from datetime import timedelta | ||
|
|
||
|
|
||
| class EstateProperty(models.Model): |
There was a problem hiding this comment.
What are the different types of models which we can use?
Also why have you used models.Model here specifically?
There was a problem hiding this comment.
There are 3 types models.Model , models.TransientModel and models.AbstractModel
i have used models.Model as we want to store its data permanently in the database
|
|
||
| property_type_id = fields.Many2one('estate.property.type', string="Property Type") | ||
| buyer_id = fields.Many2one('res.partner', string="Buyer", copy=False) | ||
| seller_id = fields.Many2one('res.users', string="Seller", default=lambda self: self.env.user) |
There was a problem hiding this comment.
What is a lambda function? And why do we need to use this function here?
There was a problem hiding this comment.
lamda is small one line function and i have used it to set dynamic default value as when new record is been created then it set the date at that moment when the server starts
Completed last Exercise Added New model with their Form and list View Completed One2many relations
44870df to
806d439
Compare
Completed 1st Exercise Added New total_area computed field Learned about computed field and applied suggestions

initial setup of real estate module - Done
Basic structure of estate module - Done
Estate Property Model Using ORM -Done